package com.example.demo.dao;

import com.example.demo.model.BookInfo;
import com.example.demo.service.BookService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@Slf4j
@Service
public class BookDao {

    @Autowired
    private BookService bookService;
    public List<BookInfo> mockData(){
        List<BookInfo> list=new ArrayList<>();
        for(int i=0;i<10;i++){
            BookInfo book=new BookInfo();
            book.setId(i);
            book.setAuthor("作者:"+i);
            book.setBookName("书名:"+i);
            book.setPrice(new BigDecimal(new Random().nextInt(100)));
            book.setCount(new Random().nextInt(50));
            book.setPublish("出版社:"+i);
            book.setStatus((new Random().nextInt(2)));
            list.add(book);
        }
        return list;
    }


}
